var RunLayer_10 = BaseLayer10.extend({
	frame:[],
	num:0,
	no:0,
	curSel:null,
	ctor:function (parent) {
		this._super(parent,5);
		this.init();
	},
	init:function () {
		cc.log("冰箱的工作原理");
		this._super();
		//第一次加载，弹框提示
		this.loadWin();
		this.loadInfo();		
		//加载主图（冰箱）
		this.loadMain();
		if(gg.teach_type == TAG_REAL){
			//实战模式下，随机一个部位闪烁
			this.loadFlash();
		}				
	},
	loadInfo:function(){
		for(var i in teach_flow10){
			var info = teach_flow10[i];
			if(info.tag == TAG_BINGXIANG){
				//读取Flow里的任务流
				this.frameInfo = info.frameInfo;
				//复制一个数组，做实战中删除用
				this.frame = this.frameInfo.concat();
			}
		}		
	},
	loadWin:function(){
		if(gg.firstRun){
			gg.synch_l = true;
			var tip = ll.tip.getChildByTag(TAG_TIP);
			tip.setEnable(false);
			var back = ll.tip.getChildByTag(TAG_CLOSE);
			back.setEnable(false);
			var win = new WinFrame(ll.tip,3,"点击右侧结构名称");
			win.open2();
			gg.firstRun = false;
		}					
	},
	loadMain:function(){
		//冰箱主图
		this.body = new cc.Sprite("#bingxiang/body.png");
		this.body.setPosition(cc.p(gg.width*0.39, gg.height*0.45));
		this.body.setScale(2.5);
		if(gg.teach_type == TAG_REAL){
			this.body.setOpacity(50);
		}else {
			this.body.setOpacity(255);
		}		
		this.addChild(this.body,1);
		var bw = this.body.width;
		var bh = this.body.height;
		for(var i in this.frameInfo){
			var info = this.frameInfo[i];	
			if(!gg.flow.over_flag){
				info.finish = false;
				info.doRight = false;
			}
			var bt = new Button(this.body,10,info.tag,info.img,this.callback,this);
			bt.setPosition(cc.p(info.px, info.py));
			bt.setAnchorPoint(0,1);
			bt.setOpacity(1);
			bt.info = info;
		}				
		//加载名称
		this.loadTipFrame();
	},
	callback:function (p){
		this.body.setOpacity(50);
		switch (p.getTag()) {
		case TAG_BINGXIANG_LENGDONGSHI:
		case TAG_BINGXIANG_LENGNINGQI:
		case TAG_BINGXIANG_QIHUA:
		case TAG_BINGXIANG_YEHUA:
		case TAG_BINGXIANG_YASUOJI:
		case TAG_BINGXIANG_ZHENGFAQI:
			this.clickCheck(p);						
			break;			
		default:
			break;
		}
		if(gg.teach_type == TAG_REAL){
			if(!gg.flow.over_flag){
				if(gg.succeed_bingxiang){			
					this.runAction(cc.sequence(cc.delayTime(1),cc.callFunc(function() {
						gg.flow.next();
					}, this)));		
				}
			}
		}		
	},
	destroy:function(){
		this._super();
	},
	onExit:function(){
		this._super();
	}
});